clear all
set more off

cd "C:\Dropbox\Average_target_survey\replication_folder\workfiles"
use step011, clear

gen DAY=dow(Date)
*** standardize variables
foreach var in count_FED count_MP count_INFLATION count_POWELL {
    sum `var' if Date<=22144
	gen s`var' =  `var'/r(mean)
	gen s1`var' =  (`var'-r(mean))/r(sd)
	
	reg `var' i.DAY if Date<=22144
	predict s2`var', rstandard
	
	
	
}

	
	
*** raw counts: consistent measurement	  
twoway (line count_FED Date if Date>22134, lcolor(black) lwidth(thick))	 ///
	   (line count_MP Date if Date>22134, lcolor(red) lpattern(longdash))	 ///
	   (line count_INFLATION Date if Date>22134, lcolor(blue) lpattern(dash))	 ///
	   (line count_POWELL Date if Date>22134, lcolor(green) )	 ///
	   , ///
	   legend(label(1 "Federal Reserve") ///
			  label(2 "Monetary Policy") ///
			  label(3 "Inflation") ///
			  label(4 "Powell") ///
			  rows(4) ring(0) position(1) rowgap(0.2)) ///
		graphregion(color(white)) bgcolor(white)   ///
		///
		ytitle("Document count") ///
		xlabel(22140 22147 22154 22161 22173 22194 22225, angle(30)) ///
		xtitle("") ///
		xline(22154, lpattern(shortdash) lwidth(normal) lcolor(black)) ///
		text(750 22156 "Announcement", orientation(vertical)) ///
		///
		xline(22146, lpattern(shortdash) lwidth(thin) lcolor(gold)) ///		
		xline(22195, lpattern(shortdash) lwidth(thin) lcolor(gold)) ///
		text(850 22197 "FOMC minutes", color(gold) orientation(vertical)) ///
		///
		xline(22174, lpattern(shortdash) lwidth(thin) lcolor(green)) ///
		xline(22224, lpattern(shortdash) lwidth(thin) lcolor(green)) ///
		text(800 22176 "FOMC press conference", color(green) orientation(vertical)) ///	
		name(fig_raw1, replace)
		
		

	
*** raw counts: consistent measurement	  
twoway (line count_FED Date if Date>22134, lcolor(black) lwidth(thick))	 ///
	   (line count_MP Date if Date>22134, lcolor(gray10) lpattern(longdash) lwidth(thick))	 ///
	   (line count_INFLATION Date if Date>22134, lcolor(black) lpattern(dash))	 ///
	   (line count_POWELL Date if Date>22134, lcolor(black) )	 ///
	   , ///
	   legend(label(1 "Federal Reserve") ///
			  label(2 "Monetary Policy") ///
			  label(3 "Inflation") ///
			  label(4 "Powell") ///
			  rows(4) ring(0) position(1) rowgap(0.2)) ///
		graphregion(color(white)) bgcolor(white)   ///
		///
		ytitle("Document count") ///
		xlabel(22140 22147 22154 22161 22173 22194 22225, angle(30)) ///
		xtitle("") ///
		xline(22154, lpattern(shortdash) lwidth(normal) lcolor(black)) ///
		text(750 22156 "Announcement", orientation(vertical)) ///
		///
		xline(22146, lpattern(shortdash) lwidth(thin) lcolor(black)) ///		
		xline(22195, lpattern(shortdash) lwidth(thin) lcolor(black)) ///
		text(850 22197 "FOMC minutes", color(black) orientation(vertical)) ///
		///
		xline(22174, lpattern(longdash) lwidth(thin) lcolor(black)) ///
		xline(22224, lpattern(longdash) lwidth(thin) lcolor(black)) ///
		text(800 22176 "FOMC press conference", color(black) orientation(vertical)) ///	
		name(fig_raw2, replace)
		
		

		
		
		
		
		
		
		
		